﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace blackhouse.Data {
	public class DataOperation : IDataOperation {

		#region Fields

		private IDataOperation innerObj;

		#endregion

		#region Constructors

		public DataOperation(object decoratedObject) {
			this.innerObj = decoratedObject as IDataOperation;
			if(this.innerObj == null) this.innerObj = new NULLDataOperation();
		}

		#endregion

		#region IDataOperation Members

		bool IDataOperation.Delete() {
			return this.innerObj.Delete();
		}

		bool IDataOperation.Exist() {
			return this.innerObj.Exist();
		}

		bool IDataOperation.IsValid() {
			return this.innerObj.IsValid();
		}

		bool IDataOperation.Save() {
			return this.innerObj.Save();
		}

		#endregion
	}
}
